RequireScript("menu.js");
RequireScript("map.js");
RequireScript("help.js");
RequireScript("fight.js");
var f = GetSystemFont();
function stopLoop(y,h)
{
y = (-h+1);
}
function Intro()
{
  var font = GetSystemFont();
  var txt = "The Intro Text goes here....\n"+
  "I don't know why I'm saying anything,\n"+
  " this is still in dev...";
  var background = LoadImage("bg.png");
  
  var x = 0;
  var y = GetScreenHeight() + 10;
  var h = 50;
  var w = GetScreenWidth();
  
  while (y > -h)
  {
			if(IsKeyPressed(KEY_ENTER))
			{
				y = (-h+1);
			}
    background.blit(0, 0);
    font.drawTextBox(x, y, w, h, 0, txt);
    
    FlipScreen();
    
    y -= 3;
    
    var start = GetTime();
    while(start + 75 > GetTime())
    {
			if(IsKeyPressed(KEY_ENTER))
			{
				y = (-h+1);
			}
		}
  }
}

function startGame()
{
var deer = new Combatant("Deer");
deer.hp = 20;
	combatants.push(deer.clone());
	//Intro();
	loadMap("start_map.rmp");

}
function game()
{
var my_menu = new Menu();
my_menu.addItem("Play", "Play game", startGame);
my_menu.addItem("Help", "Instructions", help);
my_menu.addItem("Exit", "Exit to Desktop", Exit);
my_menu.execute(GetScreenWidth()/2-80, GetScreenWidth()/2-80, 160, 80);
}
function Exit()
{
return;
}
